package com.allwees.core.common.constant;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * 收支类型
 *
 * @author yangylsky
 * @since 2019-12-12
 *
 */
public enum EWithdrawAccountType implements IEnum<Integer> {
	COMPANY(1, "公司"),

	INDIVIDUAL(2, "个人");

	private int type;

	private String desc;

	EWithdrawAccountType(int type, String desc) {
		this.type = type;
		this.desc = desc;
	}

	public String desc() {
		return desc;
	}

	public static String getDescByAccountType(Integer accountType) {
		for (EWithdrawAccountType temp : EWithdrawAccountType.values()){
			if (accountType == temp.getValue()) {
				return  temp.desc();
			}

		}
		return "";
	}

	@Override
	public Integer getValue() {
		return type;
	}
}
